package com.ruoyi.web.controller.gis;

import com.ruoyi.base.domain.BusWarnWarninfo;
import com.ruoyi.base.service.IBusWarnWarninfoService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.gis.domain.WarnGisVo;
import com.ruoyi.gis.service.WarnGisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/gis/warning")
public class WarnGisController extends BaseController {

    @Autowired
    private WarnGisService warnGisService;
    @Autowired
    private IBusWarnWarninfoService busWarnWarninfoService;

    /**
     * 预警点位撒点
     */
    @RequestMapping("/warnPointData")
    public AjaxResult warnPointData(WarnGisVo vo) {
      List<Map<String,Object>> list=warnGisService.warnPointData(vo);
        return AjaxResult.success(list);
    }

    /**
     * 预警信息详情
     */
    @RequestMapping("/warnDetail")
    public TableDataInfo warnDetail(WarnGisVo vo) {
        BusWarnWarninfo busWarnWarninfo=new BusWarnWarninfo();
        busWarnWarninfo.setSegmentid(vo.getPointId());
        busWarnWarninfo.setBeginTime(vo.getBeginTime());
        busWarnWarninfo.setEndTime(vo.getEndTime());
        startPage();
        List<BusWarnWarninfo> list=busWarnWarninfoService.selectBusWarnWarninfoList(busWarnWarninfo);
        return getDataTable(list);
    }


}
